package com.swuwen.ssh.hiring.dao.impl;

import com.swuwen.ssh.hiring.dao.TalentDao;
import com.swuwen.ssh.hiring.entity.TalentEntity;
import org.hibernate.query.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 求职者数据提供者
 */
@Repository
public class TalentDaoImpl extends BaseDao implements TalentDao {
    @Override
    public List<TalentEntity> queryByCodeAndId(String code, String password) {
        Query<TalentEntity> query = getSession().createQuery("from TalentEntity WHERE code=? and password=?", TalentEntity.class);
        query.setParameter(0, code);
        query.setParameter(1, password);
        return query.list();
    }
}